package com.spring.arch.common.validator.constraints;


import com.spring.arch.common.validator.InEnumValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;

/**
 * 日期格式验证注解
 * @author Frank
 * @version 1.0.0.1
 */

@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(
        validatedBy = InEnumValidator.class
)
public @interface InEnum {

    /**
     * @return 实现 EnumValuable 接口的
     */
    Class<? extends Enum> value();

    String message() default "必须在指定范围{value}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

}
